package cn.powerone.scm.service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import cn.powerone.scm.domain.ScmCustomerOrders;
import org.springframework.transaction.annotation.Transactional;

/**
 * 客户订单Service接口
 * 
 * @author PowerOne
 * @date 2025-07-04
 */
public interface IScmCustomerOrdersService 
{
    /**
     * 查询客户订单
     * 
     * @param id 客户订单主键
     * @return 客户订单
     */
    public ScmCustomerOrders selectScmCustomerOrdersById(Long id);

    /**
     * 查询客户订单列表
     * 
     * @param scmCustomerOrders 客户订单
     * @return 客户订单集合
     */
    public List<ScmCustomerOrders> selectScmCustomerOrdersList(ScmCustomerOrders scmCustomerOrders);

    /**
     * 新增客户订单
     * 
     * @param scmCustomerOrders 客户订单
     * @return 结果
     */
    public int insertScmCustomerOrders(ScmCustomerOrders scmCustomerOrders);

    /**
     * 修改客户订单
     * 
     * @param scmCustomerOrders 客户订单
     * @return 结果
     */
    public int updateScmCustomerOrders(ScmCustomerOrders scmCustomerOrders);

    /**
     * 批量删除客户订单
     * 
     * @param ids 需要删除的客户订单主键集合
     * @return 结果
     */
    public int deleteScmCustomerOrdersByIds(Long[] ids);

    /**
     * 删除客户订单信息
     * 
     * @param id 客户订单主键
     * @return 结果
     */
    public int deleteScmCustomerOrdersById(Long id);

    public int initScmCustomerOrders(Long projectId);

    public ScmCustomerOrders selectScmCustomerOrdersByOrderCode(String orderCode);

    @Transactional
    public int addAmountToTotalAmount(Long orderId, BigDecimal additionalAmount);

    public int selectCustomerOrderCountByMonth(Date yesterday);

    public int selectCustomerOrderCountByYear(Date yesterday);

    public int selectCustomerOrderCountAll();

    public int selectCustomerOrderCountNotPayed();

    public int selectCustomerOrderCountExpiring(Date fiveDaysAgo);
}
